package band.wukong.practice.springboot.spring4.mvc;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;

/**
 * @author wukong(wukonggg@139.com)
 */
@ControllerAdvice(basePackages = "band.wukong.practice.springboot.spring4.mvc")
public class SampleControllerAdvice {

    @ModelAttribute
    public void addAttribuite(Model model) {
        model.addAttribute("msg", "所有使用本Advice的Controller的Model都能获取本attribuite");
    }

}
